﻿//using Newtonsoft.Json;
using System.Collections.Generic;
//using System.IO;
namespace BetterWhitelist
{
    public class Translation
    {
        public  Dictionary<string, string> language = new Dictionary<string, string>();
        public static Translation Load(string path)
        {
            Translation translation = new Translation();
            translation.language.Add("SuccessfullyDelete", "删除成功!");
            translation.language.Add("SuccessfullyAdd", "添加成功!");
            translation.language.Add("SuccessfullyEnable", "启用成功!");
            translation.language.Add("SuccessfullyDisable", "禁用成功!");
            translation.language.Add("SuccessfullyReload", "重载成功!");
            translation.language.Add("FailedAdd", "添加失败! 该玩家已经在白名单中");
            translation.language.Add("FailedDelete", "删除失败 ! 该玩家不在白名单中");
            translation.language.Add("FailedEnable", "启用失败 ! 插件已打开");
            translation.language.Add("FailedDisable", "禁用失败 ! 插件已关闭");
            translation.language.Add("DisconnectReason", "你已被移出白名单!");
            translation.language.Add("HelpText", "用法: 输入 /bwl help 显示帮助信息.");
            translation.language.Add("NotEnabled", "插件开关已被禁用，请检查配置文件!");
            translation.language.Add("AllHelpText", "/bwl help, 显示帮助信息\n/bwl add {name}, 添加玩家名到白名单中\n/bwl del {name}, 将玩家移出白名单\n/bwl list, 显示白名单上的全部玩家\n/bwl true, 启用插件\n/bwl false, 关闭插件\n/bwl reload, 重载插件");
            translation.language.Add("NotOnList", "你不在服务器白名单中！");
            return translation;

            //if (File.Exists(path))
            //{
            //    return JsonConvert.DeserializeObject<Translation>(File.ReadAllText(path));
            //}
            //else
            //{
            //    Translation translation = new Translation();
            //    translation.language.Add("SuccessfullyDelete", "Delete successfully!");
            //    translation.language.Add("SuccessfullyAdd", "Add successfully!");
            //    translation.language.Add("SuccessfullyEnable", "Enable successfully!");
            //    translation.language.Add("SuccessfullyDisable", "Disable successfully!");
            //    translation.language.Add("SuccessfullyReload", "Reload successfully!");
            //    translation.language.Add("FailedAdd", "Add Failed ! The player already exists in the whitelist");
            //    translation.language.Add("FailedDelete", "Delete failed ! The player does not exist in the whitelist");
            //    translation.language.Add("FailedEnable", "Enable failed ! The plugin is already open");
            //    translation.language.Add("FailedDisable", "Disable failed ! The plugin is already closed");
            //    translation.language.Add("DisconnectReason", "You are removed from the whitelist!");
            //    translation.language.Add("HelpText", "Usage: type /bwl help to show the help info.");
            //    translation.language.Add("NotEnabled", "The switch of plugin is disabled,please check the config!");
            //    translation.language.Add("AllHelpText", "/bwl help to show help info\n/bwl add {name} to add a player name to the whitelist\n/bwl del {name} to remove a player from the whitelist\n/bwl list to show all players on the whitelist\n/bwl true to enable the plugin\n/bwl false to disable the plugin\n/bwl reload to reload the plugin");
            //    translation.language.Add("NotOnList", "You are not in the server whitelist");

            //    return translation;
            //}
        }
    }
}
